import { getBoxDetail } from "@/api/box";

export const useBoxDetail = () => {
  const loading = ref(false);
  const boxInfo = ref<API.BOX.BoxListItem>({});

  async function getBoxInfo(params: API.BOX.BoxDetailParams) {
    loading.value = true;
    boxInfo.value = await getBoxDetail(params);
    loading.value = false;
  }

  return {
    loading,
    boxInfo,
    getBoxInfo,
  };
};
